-
-
Notifications
You must be signed in to change notification settings - Fork 244
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added Windows Support #259
Added Windows Support #259
Conversation
Current coverage is
|
default['consul']['config']['data_dir'] = '/var/lib/consul' | ||
default['consul']['config']['ca_file'] = '/etc/consul/ssl/CA/ca.crt' | ||
default['consul']['config']['cert_file'] = '/etc/consul/ssl/certs/consul.crt' | ||
case node['os'] |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
Rebased this PR to resolve conflicts. |
@Ginja, this looks great. One problem I've found is that building all the file paths with |
@gdavison you're right, and there was brief discussion to change it here. In order to keep everything clean & standardized on both platforms (i.e. consul data lives within the |
@johnbellone how can we help this PR getting merged? |
+1 on merging. It works great on our Windows boxes |
Would you mind re-basing again? |
@@ -4,18 +4,23 @@ | |||
# | |||
# Copyright 2014-2016, Bloomberg Finance L.P. | |||
# | |||
::Chef::Node.send(:include, ConsulCookbook::Helpers) |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
* Fixes #236 * Added Windows Support (binary install_method only) using NSSM to manage the service. NSSM runs consul as the local SYSTEM user. Support for running it as another user can/should be added later. * Prevented the firewall cookbook from creating rules for disabled ports * Added & Updated spec tests * Disabled Style/ModuleFunction cop
* Simplified how attributes with paths for values are set * Changed default values for data_dir attribute to keep everything simple * Added version check to windows binary installation so that it can be upgraded
Added a Windows only attribute that allows cookbook users to override and/or add their own nssm parameters. Added logic for comparing nssm parameters as the nssm resource doesn't currently do this. Reverted the change to the default path for the data directory. Borrowed some of these ideas from @gdavison, thanks!
Added exit code 1 as an acceptable return code within `nssm_service_installed?`. If AppRotateOnline is not set for nssm, it will only rotate the logs when the service is restarted. Changed the default nssm parameters so that logs are rotated when they reach 20 MB in size.
One issue: Not a show-stopper, though |
I've got a PR incoming that'll fix that. Thanks for the head's up. I just noticed the nssm resource doesn't start services if they're stopped. So I added that check into the Windows provider. We should look at contributing some of these changes back to the nssm cookbook. |
Added a check to start Consul via nssm if it's not running. And updated consul_definition resource/provider with the new helper methods.
Be aware - this PR introduces a backward incompatibility: # Previous default value
default['consul']['config']['data_dir'] = '/var/lib/consul'
# New default value
default['consul']['config']['data_dir'] = join_path data_prefix_path, 'data'
# e.q. '/var/lib/consul/data' cc: @johnbellone |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
to manage the service. NSSM runs consul as the local SYSTEM user.
Support for running it as another user can/should be added later.
ports
be upgraded